package log4j.controller;

import java.util.ArrayList;
import java.util.List;

import org.compass.gps.impl.SingleCompassGps;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.demo.persistencia.generica.dao.impl.CompassDaoImpl;
import com.demo.persistencia.generica.modelo.Log4jdata;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"classpath:/conf/applicationContext-dao.xml",
	    "classpath:/conf/applicationContext-listaHiberXml.xml",
	    "classpath:/conf/applicationContext-compass-base.xml",
	    "classpath:/conf/applicationContext-Config.xml"
})
public class HibernateHaciaLuceneTest {

    @Autowired
    SingleCompassGps compassGps;
    
    @Autowired
    CompassDaoImpl<Log4jdata> compass;

    @Test
    public void indexar() {

        compassGps.index();

        List<Log4jdata> lstRetorno = (ArrayList<Log4jdata>)compass.buscarPaginado("clase:*",10);

        for (Log4jdata log4j : lstRetorno) {
            System.out.println("Resultado : " + log4j.toString());
        }
    }
}
